//懒加载
function lazyLoad(images) {
  // const images = document.querySelectorAll(select);
  const callback = (entries) => {
    entries.forEach((entry) => {
      if (entry.isIntersecting) {
        const image = entry.target;
        const data_src = image.getAttribute("data-src");
        image.setAttribute("src", data_src);
        ob.unobserve(image);
      }
    });
  };

  const ob = new IntersectionObserver(callback);
  images.forEach((image) => {
    ob.observe(image);
  });
}
export { lazyLoad };
